<template>
  <el-row class="tac">
    <el-col :span="4">
      <el-menu
        default-active="2"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
      >
        <el-menu-item index="0">
          <el-button style="margin: 0 auto" type="primary">新增</el-button>
        </el-menu-item>
        <el-menu-item index="1">
          <span class="menu">通用元数据</span>
        </el-menu-item>
        <el-menu-item index="2">
          <span class="menu">图书元数据</span>
        </el-menu-item>
        <el-menu-item index="3">
          <span class="menu">图片元数据</span>
        </el-menu-item>
        <el-menu-item index="4">
          <span class="menu">音频元数据</span>
        </el-menu-item>
        <el-menu-item index="5">
          <span class="menu">版权元数据</span>
        </el-menu-item>
      </el-menu>
    </el-col>
  </el-row>
</template>

<script lang="ts" setup>
const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
</script>
<style lang="scss" scoped>
.body {
  margin: 0;
}

.el-menu-item .menu {
  margin: 0 auto;
}
</style>
